/**
 * 
 */
package com.cqan.account.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.cqan.account.entity.User;
import com.cqan.account.service.UserService;
import com.cqan.common.ViewName;
import com.cqan.exception.AppException;
import com.cqan.utils.encode.EncodeUtils;

/**
 * @Description TODO
 * @author wuhui
 * @date 2012-4-27下午6:29:16
 *
 */
@Controller
@RequestMapping("/account")
public class AccountController {

	@SuppressWarnings("unused")
	private UserService userService;
	
	@RequestMapping(value="login",method=RequestMethod.GET)
	public ModelAndView login()throws AppException{
		
		User user = new User();
		user.setAccountNonExpired(false);
		user.setAccountNonLocked(false);
		user.setActivation(true);
		user.setAddress("湖南新化");
		user.setCredentialsNonExpired(false);
		user.setEnabled(true);
		user.setEmail("3535868@qq.com");
		user.setMobile("13522120508");
		user.setUsername("admin");
			user.setPassword(EncodeUtils.md5("admin"));
		
		//userService.save(user);
		return new ModelAndView(ViewName.LOGIN);
	}

	@Autowired
	public void setUserService(UserService userService) {
		this.userService = userService;
	}
	
}
